package designPattern.singleton;

import java.io.Serializable;

public class SerializableSingleton implements Serializable {
    private static SerializableSingleton INSTANCE;
    private SerializableSingleton() {

    }
    public static  SerializableSingleton getInstance() {
        INSTANCE = new SerializableSingleton();
        return INSTANCE;
    }
    //防止序列化破坏单例
    private Object readResolve() {
        return INSTANCE;
    }
}
